package cn.chenxi.hadoopproject.weatherData.controller;

import cn.chenxi.hadoopproject.base.response.JsonResult;
import cn.chenxi.hadoopproject.weatherData.pojo.dto.WeatherDataQuery;
import cn.chenxi.hadoopproject.weatherData.pojo.vo.WeatherDataVO;
import cn.chenxi.hadoopproject.weatherData.service.WeatherDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("v1/data")
@Api(tags = "日天气详情查询")
public class WeatherDataController {
    @Autowired
    private WeatherDataService weatherDataService;

    @GetMapping("/select")
    @ApiOperation("查找日天气详情")
    public JsonResult select(WeatherDataQuery weatherDataQuery) {
        List<WeatherDataVO> weatherDataVOS = weatherDataService.select(weatherDataQuery);
        return JsonResult.ok(weatherDataVOS);
    }
}
